<?php

abstract class Dcmp_Plugin_Base {

    private $_domain = NULL;
    
    protected $name = '';

    public function __construct($domain) {
        $this->_domain = $domain;
        $this->initialize();
    }
    
    protected function initialize(){
    	
    }

    protected function __($langKey) {
        return Kd_Localize_Helper::__($langKey);
    }

    protected function __f() {
        $args = func_get_args();
        return call_user_func_array(array('Kd_Localize_Helper', '__f'), $args);
    }
    
    protected function getDomain(){
    	return $this->_domain;
    }

    protected function getRequest() {
        return Kd_Web::getRequest();
    }

    protected function getResponse() {
        return Kd_Web::getResponse();
    }

    protected function getSession() {
        return Kd_Web::getSession();
    }

    protected function getVariables() {
        return Kd_Web::getVariables();
    }

    protected function getNavigation() {
        return Kd_Web::getPage()->getNavigation();
    }
    
    protected function getRouter(){
    	return $this->getDomain()->getRouter();
    }

    protected function getUrl($arguments = array(), $action = '*', $controller = '*', $component = '*') {
        return Kd_Web::getRouter()->buildUrl("$component/$controller/$action", $arguments);
    }

    public function getName() {
        return $this->name;
    }

    public function install(){}

    public function uninstall(){}

    abstract public function execute();
}